define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, undefined, Frontend, Form, Template) {

    var Controller = {
        chartpic: function () {
            data = {};
            data.with_site = chart_with_site.getDataURL();
            data.media = chart_media.getDataURL();
            data.abroad = chart_abroad.getDataURL();
            data.access_category = chart_access_category.getDataURL();
            console.log(data);
            if(data){
                $.ajax({
                    type: "post",
                    data: {
                        pics: data
                    },
                    url: '/api/website/saveImg',
                    async: true,
                    success: function(data) {
                        // console.log(picInfo);
                        console.log('图片保存成功');
                    },
                    error: function(err){
                        console.log('图片保存失败');
                    }
                });
            }
        }
    };
    return Controller;
});
